#ifndef OCL_CODE_INCLUDED
#define OCL_CODE_INCLUDED 1

#include "../ocl/chunk.h"
#include "../mds/sys/list.h"


/** \brief Linked list of ocl_chunk
 */
typedef struct 
{
	ocl_chunk *head;  /*!< binary layout of mds_list.head */
	ocl_chunk *tail;  /*!< binary layout of mds_list.tail */
	size_t     count; /*!< binary layout of mds_list.size */
} ocl_code;

#define OCL_CODE_INIT { NULL, NULL, 0 }

void ocl_code_init( ocl_code *code );
void ocl_code_quit( ocl_code *code );

int  ocl_code_read( ocl_code *code, const char *filename );
int  ocl_code_copy( ocl_code *code, const void *data, size_t size );

void ocl_code_add( ocl_code *code, ocl_chunk *chunk );



#endif
